﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using RomaBackend.UI;

namespace RomaBackend
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IService1
    {

        [OperationContract]
        List<UserUI> getUsers();

        [OperationContract]
        UserUI getUser(string userName);

        [OperationContract]
        UserUI getUserById(int userId);

        [OperationContract]
        List<TimeReportUI> getTimeReportsForUserBetweenDatesById(int userId, DateTime start, DateTime stop);

        [OperationContract]
        List<TimeReportUI> getTimeReportsForProjectBetweenDates(int projectId, DateTime start, DateTime stop);

        [OperationContract]
        List<TimeReportUI> getTimeReportsForUserBetweenDatesByName(string userName, DateTime start, DateTime stop);

        [OperationContract]
        TimeSpanUI getTimeSpentOnProjectByUserBetweenDates(int userId, int projectId, DateTime start, DateTime end);

        [OperationContract]
        TimeSpanUI getTimeSpentOnProjectBetweenDates(int projectId, DateTime start, DateTime end);

        [OperationContract]
        List<UserUI> getUsersInvolvedInProjectWithRole(int projectId, int role);

        [OperationContract]
        bool addTimeReport(int projectId, int userId, DateTime start, DateTime stop, string description);

        [OperationContract]
        string addUser(string name, string password, int role, string username);

        [OperationContract]
        List<ProjectUI> getProjectsWithUserInRole(int role, int userId);

        [OperationContract]
        bool addUserRoleInProject(int userId, int projectId, int role);

        [OperationContract]
        string addProject(string name, string description);

    }
}
